package com.kyzh.core.adapters

import android.graphics.Color
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.kyzh.core.R

class BqBorderAdapter(layout: Int, beans: ArrayList<String>) : BaseQuickAdapter<String, BaseViewHolder>(layout, beans) {

    override fun convert(helper: BaseViewHolder, item: String) {
        helper.setText(R.id.bq1, item)
        helper.setTextColor(R.id.bq1,
                when (helper.adapterPosition) {
                    0 -> {
                        Color.parseColor("#F87706")
                    }
                    1 -> {
                        Color.parseColor("#EBAE38")
                    }
                    else -> {
                        Color.parseColor("#FF5D5D")
                    }
                }
        )
        helper.getView<TextView>(R.id.bq1).background.setTint(
                when (helper.adapterPosition) {
                    0 -> {
                        Color.parseColor("#FFEDDE")
                    }
                    1 -> {
                        Color.parseColor("#FFF4DE")
                    }
                    else -> {
                        Color.parseColor("#FFECEC")
                    }
                }
        )
    }
}